home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / dev / gui / gengui.lha / GenGui / Examples / mux.gui < prev    next >
Encoding:
Text File  |  1994-04-22  |  1.5 KB  |  112 lines

  1. projectname Gui1
  2. vbox
  3.    button
  4.       vrel 1
  5.       text "1"
  6.       id 1
  7.    end
  8.    button
  9.       vrel 1
  10.       text "2"
  11.       id 2
  12.    end
  13. end
  14.  
  15. projectname Gui2
  16. hbox
  17.    string
  18.       vrel 1
  19.       tags GTST_MaxChars,256
  20.       id 3
  21.    end
  22.    button
  23.       vrel 1
  24.       text "2"
  25.       id 4
  26.    end
  27. end
  28.  
  29. projectname Gui3
  30. vbox
  31.    hbox
  32.       button
  33.          vrel 1
  34.          text "1"
  35.          id 5
  36.       end
  37.       button
  38.          vrel 1
  39.          text "2"
  40.          id 6
  41.       end
  42.    end
  43.    hbox
  44.       button
  45.          vrel 1
  46.          text "3"
  47.          id 7
  48.       end
  49.       button
  50.          vrel 1
  51.          text "4"
  52.          id 8
  53.       end
  54.    end
  55. end
  56.  
  57. #c_source
  58.  
  59. char *modes[]={"Mode 1","Mode 2","Mode 3",NULL};
  60. struct WinInfo *muxmodes[]={&Gui1,&Gui2,&Gui3};
  61.  
  62. int gui_mux=0;
  63.  
  64. extern struct WinInfo TestPro;
  65.  
  66. int MHook(struct IntuiMessage *msg)
  67. {
  68.    StopGui(&TestPro);
  69.  
  70.    gui_mux=msg->Code;
  71.  
  72.    ClearWindow(TestPro.Window);
  73.  
  74. /*   SetRast(TestPro.Window->RPort,0);
  75.    EraseRect(TestPro.Window->RPort,0,0,
  76.              TestPro.Window->Width-1,TestPro.Window->Height-1); */
  77.  
  78.    RefreshWindowFrame(TestPro.Window);
  79.  
  80.    RenderGui(TestPro.Window,&TestPro);
  81.    return(1);
  82. }
  83.  
  84. int Multiplex(struct WinInfo *winfo,
  85.                      struct NewGadget *ng,
  86.                      struct GadInfo *gad,
  87.                      int left, int top, int width, int height)
  88. {
  89.    return(SubGui(winfo,muxmodes[gui_mux],left,top,width,height));
  90. }
  91.  
  92. #end_source
  93.  
  94. projectname TestPro
  95. vbox
  96.    cycle
  97.       tags GTCY_Labels,(ULONG)modes
  98.       id 10
  99.       hook MHook
  100.    end
  101.    custom
  102.       custom Multiplex
  103.       id 11
  104.    end
  105. end
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.